#pragma once

#include <ostream>
#include <string>

class IpcMessageParcel {
public:
    enum class Way {
        sync,
        syncback,
        async,
        callback,
    } way;

    int callingPid = 0; // process
    int callingCid = 0; // client
    int callingSid = 0; // service
    std::string data = "";

    int Read(int fd);
    int Write(int fd);

    IpcMessageParcel();

    bool operator ==(const IpcMessageParcel &other) const;
};

std::ostream &operator <<(std::ostream &os, const IpcMessageParcel::Way& way);
